<template>
    <div id="city">
        <van-area title="城市" :area-list="areaList" :columns-num="2" @confirm="confArea"/>
    </div>
</template>

<script>
import { areaList } from '@vant/area-data';
export default {
    name:'city',
    data(){
        return {
            areaList,
            chooseValue:'',
        }
    },
    methods:{
        confArea(data){
            for(let i = 0; i<data.length; i++) {
                this.chooseValue = data[i].name
            }
            this.$emit('city',this.chooseValue)
        }
    },
}
</script>

<style scoped>

</style>